<?php

/**
 * home actions.
 *
 * @package    ogrod3d
 * @subpackage home
 * @author     Pawel Kubasiak
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class homeActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {

  }
  
  public function executeListGardenValuation(sfWebRequest $request)
  {		
	$c=new Criteria();
	$c->add(gardenPeer::USER_ID,$this->getUser()->getUserId());
	$this->garden_list=gardenPeer::doSelect($c);	
  }
  
  public function executeListOfGarden(sfWebRequest $request)
  {
	if(!$this->getUser()->isAuthenticated())
 	{
    	//$this->setReferer('@list_raport');
		$this->redirect('@sf_guard_signin');			 
	}
		
	//$c=new Criteria();
	//$c->add(gardenPeer::USER_ID,$this->getUser()->getUserId());
	//$tmp_garden_list=gardenPeer::doSelect($c);
	
	$c=new Criteria();
	$c->add(GardenPeer::USER_ID,$this->getUser()->getUserId());
	$c->addGroupByColumn(GardenItemOrderPeer::GARDEN_ID); 
	$this->garden_list=GardenItemOrderPeer::doSelectJoinAll($c);
	
  }
  
  public function executeBeforeLogin(sfWebRequest $request)
  {		
	
  }
  
  
}
